<div id="main_content" class="wrapHoliday">
    <h3><?php echo $title; ?></h3>
    <a href="<?php echo base_url('/holiday'); ?>" class="btn addEmoloyeeBack m10"><?php echo $lblBack; ?></a>
    <div class="form_add">   
        <form action="" method="post">
            <table border="0" class="add_data">
                <tr>
                    <td align="right"><label><?php echo $lblDate; ?> <font color="#FF0000">(*)</font></label></td>
                    <td>
                        <input type="hidden" name="txtHolidayId" class="txtHolidayId" value="<?php echo $holidayID; ?>" />
                        <input type="text" name="txtDate" size="10" maxlength="10" class="txtDate datepicker" value="<?php echo $txtDate; ?>" /><i>(<?php echo $this->lang->line('formatDay'); ?>)</i>
                    </td>
                    <td><div class="error"><?php echo form_error('txtDate'); ?></div></td>
                </tr>
                <tr>
                    <td align="right"><label><?php echo $lblDescription; ?> </label></td>
                    <td><textarea class="txtDescription" name="txtDescription" rows="5" cols="30" maxlength="1000"><?php echo $txtDescription ?></textarea></td>
                    <td><div class="error"><?php echo form_error('txtDescription'); ?></div></td>
                </tr>
                <?php if ($holidayID) { ?>
                    <tr>
                        <td align="right"><label><?php echo $lblDelete; ?> </label></td>
                        <td><input type="checkbox" name="txtDelete" class="txtDelete" value="1" <?php echo ($txtDelete) ? 'checked' : ''; ?>/></td>
                        <td><div class="error"><?php echo form_error('txtDelete'); ?></div></td>
                    </tr>
                <?php } ?>
                <tr>
                    <td align="left"><input type="submit" name="btnSubmit" value="<?php echo $submit; ?>"></td>            
                    <td></td>
                    <td></td>
                </tr>                                                                                         
            </table> 
        </form>
    </div>
</div>
<!-- BEGIN dialog message -->
<div id="dialog" title="<?php echo $dialogTitle; ?>">
    <?php echo isset($message) ? $message : ''; ?>
</div>
<!-- END dialog message -->
<script type="text/javascript">
    $(document).ready(function() {
        $(function() {
            $(".datepicker").datepicker({
                dateFormat: 'yy/mm/dd',
                showOn: "button",
                buttonImage: "<?php echo base_url(); ?>/public/sites/images/calendaricon.gif",
                buttonImageOnly: true,
                changeMonth: true,
                changeYear: true,
                yearRange: '<?php echo $minYear . ':' . $maxYear; ?>'
            });
        });
<?php if (isset($flag) && $flag == TRUE): ?>
            $(function() {
                $("#dialog").dialog({
                    modal: true,
                    close: function() {
                        window.location.href = '<?php echo base_url('/holiday'); ?>';
                    },
                    buttons: [{
                            text: '<?php echo $this->lang->line('MC019'); ?>',
                            click: function() {
                                window.location.href = '<?php echo base_url('/holiday'); ?>';
                            }
                        }],
                });
            });
<?php elseif (isset($flag) && $flag == FALSE): ?>
            $(function() {
                $("#dialog").dialog({
                    buttons: [{
                            text: '<?php echo $this->lang->line('MC019'); ?>',
                            click: function() {
                                $("#dialog").dialog('close');
                            }
                        }]
                });
            });
<?php endif; ?>
    });
</script>